package com.brave.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.StringRedisSerializer;
import org.springframework.stereotype.Component;

/**
 * PackageName:com.nodiot.config
 * CreateTime:2019/5/18 -8:15
 * Author:BraveKing
 * Params:
 **/
@Component
@Configuration
public class RedisTemplateConfiguration
{
    @Bean
    public RedisTemplate redisTemplate(RedisTemplate redisTemplate)
    {
        redisTemplate.setKeySerializer(new StringRedisSerializer());
        redisTemplate.setValueSerializer(new StringRedisSerializer());
        redisTemplate.setHashKeySerializer(new StringRedisSerializer());
        redisTemplate.setHashValueSerializer(new StringRedisSerializer());
        return redisTemplate;
    }
}